import java.util.*;
import java.util.concurrent.*;

public class BigTest implements CallbackInterface
{
	static final int numPTest = 200;

	private Explorer[] exs = new Explorer[numPTest];

	public BigTest()
	{
		for (int i = 0; i < numPTest; i ++)
		{
			double[] coe = new double[Explorer.coes],
			     	 dir = new double[Explorer.coes];
	
			exs[i] = new Explorer(coe, dir, this, i);
		}
	}

	public synchronized void iAmDone(int result, final double[] coe, int ind, int spawn)
	{
		System.out.println(result);
	}

	public void copy(double[] a, double[] b, int tot)
	{
		for (int i = 0; i < tot; i ++)
		{
			a[i] = b[i];
		}
	}

	public void run(double[] coe)
	{
		ExecutorService executor = Executors.newFixedThreadPool(8);

		int iter = numPTest;

		for (int i = 0; i < iter; i ++)
		{
			copy(exs[i].getCoe(), coe, Explorer.coes);

			executor.execute(exs[i]);
		}

		executor.shutdown();

		while (!executor.isTerminated()) {}
	}

    public static double[] strToCoe(String str){
        String[] each = str.split(", ");
        double[] r = new double[each.length];
        for(int i = 0; i < each.length; i++){
            r[i] = Double.parseDouble(each[i]);
        }
        return r;
    }

	public static void test(String coeStr){
        double[] coe = strToCoe(coeStr);
		//double[] coe = {36.410178720504824, 39.30232608095497, 121.12548516513772, 3.2666639386589913, 44.27670728219611, 26.386928365072578, -59.447392724301004, 76.70103297569833, 69.8064565712707, 264.62079806632426};
		System.out.println("\"Coe: " + Swarm.coeToString(coe) + "\"");
		BigTest test = new BigTest();
		test.run(coe);
        System.out.println();
	}

    public static void main(String argv[]){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            String str = sc.nextLine();
            test(str);
        }
    }
}
